import {localStorageGet} from "../assets/js/localStorage";

const routerHandler = (to, from, next) => {
  if (to.path == '/user') {
    if(!localStorageGet('token')){
      next({
        path: '/login',
      })
    }else {
      next()
    }
  } else {
    next()
  }
}

export default routerHandler
